﻿@if (viewmode == "login")
{
  <style>
    .label_1 {
      display: inline-block;
      width: 100px;
      text-align: right;
    }
  </style>
  <h1>Login</h1>
  <EditForm Model="this">
    <span class="label_1">server:</span><InputText @bind-Value="server" />
    <br />
    <span class="label_1">username:</span><InputText @bind-Value="username" />
    <br />
    <span class="label_1">password:</span><InputText type="password" @bind-Value="password" />
    <br />
    <span class="label_1"></span><button @onclick="DoLogin">Login</button>
  </EditForm>
  return;
}

@if (viewmode == "connecting")
{
  <div>
    Connecting... @server as @username , Please wait...
    <br />
    <button @onclick="ConnectingCancel">Cancel</button>
  </div>
  return;
}

<h1>SSH Console</h1>
<p>
  Connected:@client.IsConnected
  <br />
  @client.ConnectionInfo.ServerVersion
</p>
<BlazorDomTree OnRootReady="BDTReady" style="max-width:90%;" />
<hr />
<div>
  tips
</div>
<div>
  Run a app and keep it alive : <span style="color:blue">sudo nohup /home/pi/dotnet/dotnet myprogram.dll &</span>
</div>